/**
 * {
  xml: {
    tousername: [ 'gh_506390a6d691' ],
    fromusername: [ 'o1hx4v2wG4L22OUyxpYQeYv3j6S8' ],
    createtime: [ '1690941603' ],
    msgtype: [ 'text' ],
    content: [ '你好' ],
    msgid: [ '24208465622116618' ]
  }
}
 */
function formatXml(xml) {
  const arr = Object.keys(xml)
  const result = arr.reduce((obj, key) => {
    obj[key] = xml[key][0]
    return obj
  }, {})
  return result
}

module.exports = {
  formatXml
}